<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/', function () {

//     return view('home.index.index');
// });

/*xxxxxxxxxxxxxxxxxxxxxxxxx后台路由开始xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/

/*xxxxxxxxxxxxxxxxxxxxxxxxx用户路由开始xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/


Route::get('/admin/user/index','Admin\userController\indexController@index');
Route::get('/admin/user/add','Admin\userController\userController@add');
Route::post('/admin/user/insert','Admin\userController\userController@insert');
//修改用户
Route::get('/admin/user/changeAddr','Admin\userController\indexController@changeAddr');
Route::get('/admin/user/edit/{uid}','Admin\userController\indexController@edit');
Route::get('/admin/user/change/{uid}','Admin\userController\userController@change');
Route::post('/admin/user/changep','Admin\userController\userController@changep');
Route::post('/admin/user/update/','Admin\userController\indexController@update');
Route::get('/admin/user/delete/{uid}','Admin\userController\indexController@delete');
//登录验证码
Route::get('/admin/login','Admin\loginController@login');
Route::post('/admin/login','Admin\loginController@login');
Route::get('/admin/logout','Admin\loginController@logout');
Route::get('/admin/code/{random?}','Admin\CodeController@code');
//邮箱验证
Route::get('/admin/reset/forget','Admin\resetController@forget');
Route::post('/admin/reset/send','Admin\resetController@send');
Route::get('/admin/reset/find/{uid}','Admin\resetController@find');
Route::get('/admin/reset/info','Admin\resetController@info');
Route::post('/admin/reset/uppass','Admin\resetController@uppass');
/*xxxxxxxxxxxxxxxxxxxxxxxxx用户路由结束xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/

/*xxxxxxxxxxxxxxxxxxxxxxxxx分类路由开始xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/

// Route::get('/admin/type/add','Admin\typeController@add');
// Route::get('/admin/type/index','Admin\typeController@index');
// Route::post('/admin/type/insert','Admin\typeController@insert');

//资源控制器 resource
Route::resource('/admin/type','Admin\categoryController');

/*xxxxxxxxxxxxxxxxxxxxxxxxx分类路由结束xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/


/*xxxxxxxxxxxxxxxxxxxxxxxxx商品路由开始xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/

Route::get('/admin/good/add','Admin\goodController@add');
Route::get('/admin/good/find','Admin\goodController@find');
Route::post('/admin/good/insert','Admin\goodController@insert');

//商品库存修改
Route::get('/admin/good/changeCnt', 'Admin\goodController@changeCnt');
//商品修改
Route::get('/admin/good/edit/{gid}', 'Admin\goodController@edit');
Route::post('/admin/good/update', 'Admin\goodController@update');
Route::get('/admin/good/delete/{gid}', 'Admin\goodController@delete');
//订单处理
Route::resource('/admin/order','Admin\orderController');

/*xxxxxxxxxxxxxxxxxxxxxxxxx商品路由结束xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/*xxxxxxxxxxxxxxxxxxxxxxxxx后台路由结束xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/*xxxxxxxxxxxxxxxxxxxxxxxxx前台路由开始xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/

//首页路由
Route::get('/','Home\indexController@index');
Route::get('/home/index/logon','Home\loginController@index');
Route::post('/home/index/login','Home\loginController@login');
Route::get('/home/index/logout','Home\loginController@logout');
Route::get('/home/index/register','Home\loginController@register');
Route::post('/home/index/insert','Home\loginController@insert');
Route::post('/home/index/email/','Home\emailController@email');
Route::get('/home/index/userInfo','Home\userInfoController@index');
Route::post('/home/index/edit','Home\userInfoController@edit');
Route::get('/home/index/delete/{oid}','Home\userInfoController@delete');
Route::get('/home/index/status/{oid}','Home\userInfoController@status');
//用户签到
Route::get('/home/index/sign','Home\userInfoController@sign');
Route::get('/home/index/draw','Home\userInfoController@draw');
//商品页路由
//商品
Route::get('/home/good/index/{tid?}','Home\goodController@index');
Route::get('/home/good/list/{gid}','Home\goodController@list');
Route::post('/home/good/insert','Home\goodController@insert');




//购物车

Route::get('/home/cart/index','Home\cartController@index');
Route::get('/home/cart/delete/{cid}','Home\cartController@delete');
Route::post('/home/cart/insert','Home\cartController@insert');
//订单
Route::get('/home/order/index','Home\orderController@index');
Route::post('/home/order/insert','Home\orderController@insert');
Route::get('/home/order/jsy','Home\orderController@jsy');
Route::post('home/order/ok','Home\orderController@ok');



//前台心情分享
Route::get('/home/message/add', 'Home\messagecontroller@add')->middleware('homelogin');
Route::post('/home/message/insert', 'Home\messagecontroller@insert');
Route::get('/home/message/index', 'Home\messagecontroller@index');
Route::get('/home/message/review/{uid}', 'Home\messagecontroller@review')->middleware('homelogin');
Route::post('/home/message/update', 'Home\messagecontroller@update');
Route::get('/home/message/sAdd','Home\messagecontroller@sAdd');

/*xxxxxxxxxxxxxxxxxxxxxxxxx前台台路由结束xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/